package com.sskj.award.http;


import com.lzy.okgo.OkGo;
import com.lzy.okgo.request.GetRequest;
import com.lzy.okgo.request.PostRequest;
import com.sskj.award.bean.AirDropBean;
import com.sskj.award.bean.AirdropBillBean;
import com.sskj.award.bean.DividendRecordBean;
import com.sskj.award.bean.KongTouBean;
import com.sskj.award.bean.PlatformDataBean;
import com.sskj.award.bean.SuperAbonusBean;
import com.sskj.award.bean.SuperPlatformBean;
import com.sskj.award.bean.WelfareDistrictBean;
import com.sskj.common.base.HttpData;
import com.sskj.lib.bean.PageBean;

import java.util.List;

/**
 * 作者 :吕志豪
 * 简书：https://www.jianshu.com/u/6e525b929aac
 * github：https://github.com/lvzhihao100
 * 描述：
 * 创建时间：2018-10-15 14:08
 */
public class HttpService {

    /**
     * 释放记录或者动态奖励数据
     *
     * @param page 页码
     * @param type 类型  释放记录或者动态奖励
     * @return
     */
    public PostRequest<HttpData<PageBean<SuperPlatformBean>>> getGonggaoList(String page, String type) {
        return OkGo.<HttpData<PageBean<SuperPlatformBean>>>post(HttpConfig.BASE_URL + HttpConfig.GET_RECORD_LIST)
                .params("page", page)
                .params("size", 15)
                ;
    }

    /**
     * 超级平台信息返回
     *
     * @return
     */
    public GetRequest<HttpData<PlatformDataBean>> getPlatformData(String page) {
        return OkGo.<HttpData<PlatformDataBean>>get(HttpConfig.BASE_URL + HttpConfig.GET_PLATFORM_DATA)
                .params("page",page);
    }

    public PostRequest<HttpData<PlatformDataBean>> upDataSuperUser(String payment_password) {
        return OkGo.<HttpData<PlatformDataBean>>post(HttpConfig.BASE_URL + HttpConfig.UPDATA_SUPER_PLATFORM)
                .params("payment_password", payment_password);
    }

    /**
     * 手续费福利区
     *
     * @return
     */
    public GetRequest<HttpData<WelfareDistrictBean>> getDistrictData() {
        return OkGo.<HttpData<WelfareDistrictBean>>get(HttpConfig.BASE_URL + HttpConfig.GET_DISTRICT_DATA);
    }

    /**
     * 参与手续费福利区
     *
     * @return
     */
    public PostRequest<HttpData> onCreateParticipate(String code, String payment_password, String money, String type) {
        return OkGo.<HttpData>post(HttpConfig.BASE_URL + HttpConfig.ON_CREATE_PARTICIPATE)
                .params("code", code)
                .params("payment_password", payment_password)
                .params("money", money)
                .params("type", type)
                ;
    }

    /**
     * 手续费福利区记录
     *
     * @return
     */
    public GetRequest<HttpData<DividendRecordBean>> getRecordData(String type, String page) {
        return OkGo.<HttpData<DividendRecordBean>>get(HttpConfig.BASE_URL + HttpConfig.GET_PARTICIPATE_RECORD_DATA)
                .params("page", page)
                .params("type", type)
                ;
    }


    /**
     * 获取空投区对应的账单
     *
     * @param wall_code 币种识别值
     * @param page      页数
     * @return
     */
    public GetRequest<HttpData<KongTouBean>> getBillData(String wall_code, String page) {
        return OkGo.<HttpData<KongTouBean>>get(HttpConfig.BASE_URL + HttpConfig.GET_AIR_DROP_BILL_DATA)
                .params("code", wall_code)
                .params("page", page)
                ;
    }


    /**
     * 手续费福利去分红记录
     *
     * @param type 类型
     * @param page 页数
     * @return
     */
    public GetRequest<HttpData<DividendRecordBean>> getMoryRecordData(String type, String page) {
        return OkGo.<HttpData<DividendRecordBean>>get(HttpConfig.BASE_URL + HttpConfig.GET_PARTICIPATION_RECORD_DATA)
                .params("page", page)
                .params("type", type);
    }

    public GetRequest<HttpData<AirDropBean>> getAirData() {
        return OkGo.<HttpData<AirDropBean>>get(HttpConfig.BASE_URL + HttpConfig.GET_AIR_DATA);
    }

    public GetRequest<HttpData<KongTouBean>> getAirStateData(String code,String page) {
        return OkGo.<HttpData<KongTouBean>>get(HttpConfig.BASE_URL + HttpConfig.GET_AIR_State_DATA)
                .params("code",code)
                .params("page",page);
    }

    public GetRequest<HttpData<SuperAbonusBean>> getABonusData() {
        return OkGo.<HttpData<SuperAbonusBean>>get(HttpConfig.BASE_URL + HttpConfig.GET_ABONUS_DATA);
    }
}
